<?php 

include "scripts/connectDB.php";

$res = mysql_query("SELECT * FROM rank ORDER BY rank_id ASC")
or die("Invalid query: " . mysql_query());
echo '<select name="rank_id">';
echo '<option value="rank_id">Velg rank</option>';

while ($row = mysql_fetch_assoc($res)) {
$rank_id = $row['rank_id'];
$rank = $row['rank'];
echo "<option value='$rank_id'>$rank</option>";
}
echo '</select>';
?>

